# set1 = set()
# print(set1)

# list1 = ["aaa", "bbb", "ccc"]
# set2 = set(list1)
# print(set2)

# dict1 = {"name":"wuyutao", "age":18}
# print(set(dict1))

# dict1 = ("aaa", "bbb", "ccc")
# print(set(dict1))

# basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
# print(basket)

# basket = set()
# basket.add("apple")
# basket.add("orage")
# basket.add("apple")
# print(basket)
# print(len(basket))

# basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
# if 'apple' in basket:
#     print("苹果在篮子中")
#
# if 'xiaoming' not in basket:
#     print("小明不在篮子中")

# t = set("abcdefg")
# print(t)

# import random
# print(random.sample("abcdefg", 3))

# a = set("abcd")
# b = set("cdef")
# print(a - b) # 集合a中包含的元素
# print(b - a) # 集合b中包含的元素
# print(a & b) # 集合a和b中都包含的元素
# print(a | b) # 集合a和b中包含的所有元素
# print(a ^ b) # 在集合a和b中不同时存在的元素

# S = {1, 2, 3, 4}
# S.update({"name": "wuyutao", "age": 18}) # 把字典里的key拿出来更新到集合中
# S.update({"name": "xiaoming", "gender": True})
# print(S)
# update这个函数可以实现，当数据的字段名不同的时候，可以把字段名拿出构成一个包含所有字段名的集合

# S = {"a", "b", "c", "d", "e"}
# S.remove("c") # 从集合中删除元素，如果元素不存在会报错
# S.discard("c") # 从集合中删除元素，如果元素不存在不会报错

# S = {"a", "b", "c", "d", "e"}
# S.pop() # 随机删除集合中的一个元素
# print(S)

# S = {"a", "b", "c", "d", "e"}
# print("a" in S) # 判定元素是否在集合中

# S = "1234567890"
# print("1" in S) # 判定字符是否在字符串中

# S = "1234567890"
# print("345" in S) # 判定字符串是否属于另一个字符串的子字符串

# S = "1234567890"
# print(S.count("1")) # 判定字符串中含有几个字符"1"




